﻿<div class="@ClassString" @onclick="TriggerClick">
    <Layout IsPage="false" IsFullSide="IsFullSide" ShowFooter="true">
        <Side>
            <div class="layout-banner">
                <div class="layout-title">Logo</div>
            </div>
            <div class="layout-menu">Menu</div>
        </Side>
        <Header>
            Header
        </Header>
        <Main>
            Main
        </Main>
        <Footer>
            Footer
        </Footer>
    </Layout>
</div>

@code {
    [Parameter]
    public bool IsFullSide { get; set; }

    [Parameter]
    public bool IsActive { get; set; }

    [Parameter, NotNull, EditorRequired]
    public Func<bool, Task>? OnClick { get; set; }

    private string? ClassString => CssBuilder.Default("layout-preview")
        .AddClass("active", IsActive)
        .Build();

    private async Task TriggerClick()
    {
        await OnClick(IsFullSide);
    }
}
